﻿using System.Linq;
using Acr.XamForms.UserDialogs;
using SpotOffer.DataModels;
using SpotOffer.Resource;
using Xamarin.Forms;
using XLabs.Forms.Mvvm;

namespace SpotOffer.ViewModels
{
    public class BaseViewModel : ViewModel
    {
        protected BaseViewModel()
        {
            Dialogs = DependencyService.Get<IUserDialogService>();
        }
        private IUserDialogService _dialogs;
        public IUserDialogService Dialogs
        {
            get { return _dialogs; }
            set
            {
                _dialogs = value;
                NotifyPropertyChanged();
            }
        }
        public Color ItemBackgroundColor
        {
            get { return _itemBackgroundColor; }
            set
            {
                _itemBackgroundColor = value;
                NotifyPropertyChanged();
            }
        }
        private Color _itemBackgroundColor=AppColors.White;
        public Color ItemTextColor
        {
            get { return _itemTextColor; }
            set
            {
                _itemTextColor = value;
                NotifyPropertyChanged();
            }
        }
        private Color _itemTextColor = AppColors.DarkbluLight;
      
        public bool Higlighted
        {
            get
            {
                return _highlighted;
              
            }
            set
            {
                if (value)
                {
                    ItemBackgroundColor = AppColors.Laranja;
                    ItemTextColor = AppColors.White;
                }
                else
                {
                    ItemBackgroundColor = AppColors.White;
                    ItemTextColor = AppColors.DarkbluLight;
                }
                _highlighted = value;
                NotifyPropertyChanged();
            }
        }
        private bool _highlighted=false;
    }
}